package yunjiao.designpatterns.interpreter.expr;

import yunjiao.designpatterns.interpreter.Employee;

/**
 * TODO
 *
 * @author yangyunjiao
 */
public class DepartmentExpression extends TerminalExpression {
    protected String department;

    public DepartmentExpression(String department) {
        super();
        this.department = department;
    }

    @Override
    public boolean interpret(Employee context) {
        return context.getDepartment().name().equalsIgnoreCase(department);
    }

    @Override
    public String toString() {
        return "DepartmentExpression [department=" + department + "]";
    }
}
